﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Data;
using System.Web.UI.WebControls;
using GPSTrackingWebsiteManager.GPSTrackingController;
using GPSTrackingWebsiteManager.ClassManager;

namespace GPSTrackingWebsiteManager.Pages
{
    public partial class NotificationHistoryByToday : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void rgNotificationsGrid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            SessionManager objSessionManager = (SessionManager) HttpContext.Current.Session["SessionManager"];
            bool isAdmin = false;
            if(objSessionManager.IsAdmin || objSessionManager.IsMaster)
                isAdmin = true;

            rgNotificationsGrid.DataSource = GPSTrackingDBV2Custom.Data.DataRepository.NotificationTrackDataProvider.GetAllByUser(objSessionManager.CompanyID,  HttpContext.Current.User.Identity.Name, isAdmin);
        }
    }
}